<?xml version="1.0" encoding="UTF-8"?>
<ui:composition
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
	xmlns:f="http://xmlns.jcp.org/jsf/core"
	xmlns:h="http://xmlns.jcp.org/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:jsf="http://xmlns.jcp.org/jsf/passthrough"
	xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"
	template="/WEB-INF/templates/public/default.xhtml"
>
	<f:metadata>
		<f:viewParam name="firstResult" value="#{newFtService.firstResult}"></f:viewParam>
	   	<f:viewParam name="searchString" value="#{newFtService.searchString}"></f:viewParam>
   	</f:metadata>
	<ui:define name="head">
		<h:outputStylesheet name="css/public/other_search.css" />
		<script type="text/javascript">
		
			function searchBtnClk(){
				if($("input[id $= 'searchString']").val() != '') {
					return true;
				}
				else {
					return false;
				}
			}		

		</script>
	</ui:define>
 
	<ui:define name="content">
		<h:form id="searchForm">
		<div class="sub-container">
        <!--招标公告-->
	        <div class="sub_wrap">
	            <div class="sskbox">
	                <h:inputText
						id="searchString"
						jsf:type="search"
						jsf:placeholder="请输入关键字"
						class="search-input"
						value="#{newFtService.searchString}"
						widgetVar="searchString"
					/>
					<SCRIPT type="text/javascript"></SCRIPT>
					<h:commandButton id="searchBtn" onclick="if(!searchBtnClk()){return false;}" action="index-search.xhtml?faces-redirect=true&amp;includeViewParams=true&amp;firstResult=0"  value="搜索"  styleClass="ssk_btn">
						<f:setPropertyActionListener value="0" target="#{newFtService.firstResult}"></f:setPropertyActionListener>
					</h:commandButton>	
	            </div>
		        <div class="result-list pt10" id="result-list2" style="min-height:350px">
		            <p:outputPanel  rendered="#{newFtService.searchString != null}" > 
		                <p id="cphContent1_countMS" class="brief mb20">
		             	  共为您找到结果约#{newFtService.resultCount}个
		             	 </p>
		                <!--模块一-->
		               
		                <p:repeat var="_dataEntity" value="#{newFtService.resultList}">
		                	<p:outputPanel rendered="#{_dataEntity.className == 'Bulletin'}">
		                		<div class="result1 mb30">
				                    <a href="BulletinArticleView.xhtml?bulletinId=#{_dataEntity.id}&amp;&amp;showSupplier=true" target="_blank" title="#{_dataEntity.highLightTitle}"><h5><h:outputText value="#{_dataEntity.highLightTitle}" escape="false" /></h5></a>				
				                    <div class="roww">
				                       	 <h:outputText value="#{_dataEntity.highLightContent}" escape="false" />
				                       	 <p>
				                            <a>
				                                <span class="m-tools  green">
				                                	<h:outputText value="#{_dataEntity.createDate}" >
				                                		<f:convertDateTime pattern="yyyy-MM-dd HH:mm:ss"/>
				                                	</h:outputText>
				                                </span>
				                            </a>
				                        </p>
				                    </div>
				                </div>		
		                	</p:outputPanel>
		                	
		                	<p:outputPanel rendered="#{_dataEntity.className == 'Article'}">
		                		<div class="result1 mb30">
				                    <a href="Article.xhtml?articleId=#{_dataEntity.id}" target="_blank" title="#{_dataEntity.highLightTitle}"><h5><h:outputText value="#{_dataEntity.highLightTitle}" escape="false" /></h5></a>				
				                    <div class="roww">
			                       		 <h:outputText value="#{_dataEntity.highLightContent}" escape="false" />
				                       	 <p>
				                            <a>
				                                <span class="m-tools  green">
				                                	<h:outputText value="#{_dataEntity.createDate}" >
				                                		<f:convertDateTime pattern="yyyy-MM-dd HH:mm:ss"/>
				                                	</h:outputText>
				                                </span>
				                            </a>
				                        </p>
				                    </div>
				                </div>		
		                	</p:outputPanel>
		                			                	
		                	<p:outputPanel rendered="#{_dataEntity.className == 'ServiceSupplier'}">
		                		<div class="result1 mb30">
				                    <a href="SupplierView.xhtml?serviceSupplierId=#{_dataEntity.id}" target="_blank" title="#{_dataEntity.highLightTitle}"><h5><h:outputText value="#{_dataEntity.highLightTitle}" escape="false" /></h5></a>				
				                    <div class="roww">
				                       	 <h:outputText value="#{_dataEntity.highLightContent}" escape="false" />
				                       	 <p>
				                            <a>
				                                <span class="m-tools  green">
				                                	<h:outputText value="#{_dataEntity.createDate}" >
				                                		<f:convertDateTime pattern="yyyy-MM-dd HH:mm:ss"/>
				                                	</h:outputText>
				                                </span>
				                            </a>
				                        </p>
				                    </div>
				                </div>		
		                	</p:outputPanel>
		               
		                </p:repeat>
		                 <ui:include src="/WEB-INF/templates/manage/pagination.xhtml">
							<ui:param name="entityList" value="#{newFtService}" />
						</ui:include>	
		            </p:outputPanel>  
		           </div>
		            
	        </div>
    	</div>
    	</h:form>
	</ui:define>

</ui:composition>